<?php
	error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
	session_start();
    
	include('config.php');
    include('system/system.php');
    include('system/controller.php');
    include('system/model.php');
	include('system/functions.php');    
    
    function __autoload( $file ){
        if ( file_exists(MODELS . $file . '.php') )
            include( MODELS . $file . '.php' );
        else if ( file_exists(HELPERS . $file . '.php') )
            include( HELPERS . $file . '.php' );
        else
            die("Model ou Helper nao encontrado.");
    }

    $start = new System;
    $start->run();